import request from '@/utils/request';
// import { stringify } from 'qs';

// 获取录用详情
export function getRecruitmentInfo(data) {
    return request(`/api/recruitment/v1/employ/info/${data.employId}`, {
        method: 'POST',
        data
    });
}

// 提交背调表单
export function addBackgroundRec(data) {
    return request('/api/recruitment/v1/employ/background/actions/save_background_info', {
        method: 'POST',
        data
    });
}

export function getBgCompanyList(employId) {
    return request(`/api/recruitment/v1/employ/background/actions/query_company_list/${employId}`, {
        method: 'GET'
    });
}

// 获取背调表单记录
export function getBackgroundRec(data) {
    return request(`/api/recruitment/v1/employ/background/${data.employId}/background_info`, {
        method: 'GET',
        data
    });
}

// 获取背调表单记录
export function updateBackgroundRec(data) {
    return request(`/api/recruitment/v1/employ/background/actions/update_background_info/${data.id}`, {
        method: 'PUT',
        data
    });
}

// 获取发起审批流程Id
export function getProcessDefId(data) {
    return request(`/api/workflowweb/processinstance/v1/getprocessdefid?processInstanceId=${data.processInstanceId}`, {
        method: 'GET'
    });
}

// 获取候选人薪资等相关信息
export function getCandidateInfo(signCandidateId) {
    return request(`/api/recruitment/public/v1/employ/background/submit_page/candidate_info/${signCandidateId}`, {
        method: 'GET'
    });
}

// 保存候选人薪资等相关信息
export function updateCandidateInfo(data) {
    return request('/api/recruitment/public/v1/employ/background/submit_page/actions/submit_background_contact_info', {
        method: 'POST',
        data
    });
}

// 获取背调机构相关信息
export function getThirdPartyInfo(signBackgroundId) {
    return request(
        `/api/recruitment/public/v1/employ/background/submit_page/org_submit_candidate_info/${signBackgroundId}`,
        {
            method: 'GET'
        }
    );
}

// 保存背调机构相关信息
export function updateThirdPartyInfo(data) {
    return request('/api/recruitment/public/v1/employ/background/submit_page/actions/submit_org_background_info', {
        method: 'POST',
        data
    });
}

export function getRecruitRelativeInfo(resumeId) {
    return request(`/api/recruitment/v1/record_info/${resumeId}`, {
        method: 'GET'
    });
}
